<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
	<head>
		<title></title>

	
		<script type="text/javascript">
		
		
		function addCard() {
			alert(11);
			document.write("<OBJECT ID=\"CardOp\" classid=\"clsid:2E996EE8-B085-4BC7-848A-BA97FABEDE5E\" codebase=\"readcardocx.cab#version=1,0,0,4\" style=\"display:none \"></OBJECT> ");
			alert(2);
		}
		addCard();

		function f3() {
			CardOp.ServiceId = "100000000027";
	
			CardOp.GsMm = parseInt("630126");//630126 3357
			CardOp.YhMm = parseInt("5445076");//5445076 2234
			CardOp.KeyA = parseInt("2245734");
			CardOp.KeyB = parseInt("2245734");
			CardOp.m1_type = parseInt("9");
			CardOp.media_type = parseInt("9");
			CardOp.IsUp = parseInt("0");
			CardOp.Clear_Card();
			if (CardOp.Is_Ok == 1)
				alert("清卡成功");
			if (CardOp.Is_Ok == 0)
				alert("清卡失败");
		}

		function f4() {
	
			CardOp.ServiceId = "100000000027";
			CardOp.GsMm = parseInt("630126");
			CardOp.YhMm = parseInt("5445076");
			CardOp.KeyA = parseInt("2245734");
			CardOp.KeyB = parseInt("2245734");
			CardOp.IsUp = parseInt("0");
			CardOp.m1_type = parseInt("9");
			CardOp.media_type = parseInt("9");
	
			CardOp.readcard();
	
			CardOp.change_no = 10;
			CardOp.Kh = 0000900;
			CardOp.Kye = 8888;
			CardOp.RxfXe = 2000;
			CardOp.Kzt = parseInt("0");
			CardOp.XfMm = '888888';
			;
			CardOp.Klb = 2;
			CardOp.Gender = parseInt(1);
	
			CardOp.create_new_card();
	
			if (CardOp.Is_Ok == 1) {
				alert("写卡成功...");
			} else if (CardOp.Is_Ok == 2) {
				alert("此卡已使用，请更换下一张新卡！");
			} else if (CardOp.Is_Ok == 3) {
				alert("请放卡！");
			} else if (CardOp.Is_Ok == 0) {
				alert("发卡失败");
			}
	
		}

	//读卡
	function f5() {

		CardOp.ServiceId = "100000000027";
		CardOp.GsMm = parseInt("630126");
		CardOp.YhMm = parseInt("5445076");
		CardOp.KeyA = parseInt("2245734");
		CardOp.KeyB = parseInt("2245734");
		CardOp.IsUp = parseInt("1");

		CardOp.m1_type = parseInt("9");
		CardOp.media_type = parseInt("9");

		CardOp.readcard();
		alert("脱机总额=" + CardOp.tjze + "   区域号=" + CardOp.change_no + "  逻辑号="
				+ CardOp.Kh + "  卡状态=" + CardOp.kzt + "  卡类别=" + CardOp.klb
				+ "  卡余额=" + CardOp.Kye + " 日消费限额=" + CardOp.RxfXe + "   卡余额="
				+ CardOp.Kye);
	}
</script>
	</head>
	<body style="padding: 10px">
	
		<OBJECT ID="CardOp" classid="clsid:2E996EE8-B085-4BC7-848A-BA97FABEDE5E" codebase="/readcardocx.cab#version=1,0,0,4" style="display:none"></OBJECT>
	
		<input type="button" value="读S70卡" onclick="f5();" />

		<input type="button" value="写卡" onclick="f4();" />
		<input type="button" value="清卡" onclick="f3();" />
	</body>
</html>
